﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Proje
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        

        private void button1_Click(object sender, EventArgs e)
        {
            Employee employee = new Employee();

            employee.name = name.Text;
            employee.lastName = lastName.Text;
            employee.tcNo = Convert.ToInt64(tc.Text);
            employee.salary = Convert.ToDouble(salary.Text);
            employee.position = (string)position.SelectedItem;
            employee.phone = phone.Text;
            employee.birthdate = date.Text;

            EmployeeFileConnector connector = new EmployeeFileConnector();
            if (connector.insert(employee))
            {
                MessageBox.Show("Calisan Eklendi!");
            }
            else
            {
                MessageBox.Show("Calisan Eklenemedi!");
            }
        }
    }
}
